﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Utility
{
    public class WhereStr
    {
        public static string GetWhereStr(WhereState whereState, string key, string value)
        {
            string whereStr = WhereState.eq == whereState ? string.Format("{0} = '{1}'", key, value) :
                WhereState.gt == whereState ? string.Format("{0} >'{1}'", key, value) :
                WhereState.include == whereState ? string.Format("{0}  in ('{1}')", key, value) :
                WhereState.like == whereState ? string.Format("{0} like '%{1}%'", key, value) :
                string.Format("{0}  i < '{1}'", key, value);
            return whereStr;
        }
    }
}
